main() {
	unsigned long i = 1, j = 1;	
	for (; i <= 1000000; ++i) {
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3; j*=3;
		j = 1;
	}
	return j+i;
}
